
#ifndef __SYSMODULE__H__
#define __SYSMODULE__H__

#include <ntifs.h>
#include "common.h"

typedef struct _LDR_DATA_TABLE_ENTRY {
    LIST_ENTRY InLoadOrderLinks;
    LIST_ENTRY InMemoryOrderLinks;
    LIST_ENTRY InInitializationOrderLinks;
    PVOID DllBase;
    PVOID EntryPoint;
    ULONG SizeOfImage;
    UNICODE_STRING FullDllName;
    UNICODE_STRING BaseDllName;
    ULONG Flags;
    USHORT LoadCount;
    USHORT TlsIndex;
    union {
        LIST_ENTRY HashLinks;
        struct {
            PVOID SectionPointer;
            ULONG CheckSum;
        };
    };
    union {
        struct {
            ULONG TimeDateStamp;
        };
        struct {
            PVOID LoadedImports;
        };
    };
    PVOID EntryPointActivationContext;
    PVOID PatchInformation;

} LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;

typedef struct _DRIVER_MODULE_INFO{
    PVOID DllBase;
    PVOID EntryPoint;
    ULONG SizeOfImage;
    WCHAR FullName[MAX_PATH];

}DRIVER_MODULE_INFO, *PDRIVER_MODULE_INFO;

NTSTATUS
QuerySysModuleListByPsLdModList(
    OUT PVOID DriverListBuffer,
    IN  ULONG BufferLength,
    OUT PULONG Length                               
);

#endif